package m.jclecai.com.adapter;

import android.content.Context;
import android.view.ViewGroup;

import java.util.List;

import m.jclecai.com.R;
import m.jclecai.com.adapter.base.ViewHolerAdapter;
import m.jclecai.com.adapter.holder.OrderDetailHolder;
import m.jclecai.com.bean.RecordsBean;

/**
 * Created by zd on 2017/9/29 0029.
 */

public class OrderDetailAdapter extends ViewHolerAdapter<OrderDetailHolder> {
    List<RecordsBean> records;
    Context mContext;

    public OrderDetailAdapter(Context mContext,List<RecordsBean> records) {
        this.mContext = mContext;
        this.records = records;
    }

    @Override
    public OrderDetailHolder onCreateViewHolder(int position, ViewGroup parent) {
        return new OrderDetailHolder(mContext, R.layout.item_order_detail);
    }

    @Override
    public void onBindViewHolder(int position, OrderDetailHolder orderDetailHolder) {
        orderDetailHolder.init(records.get(position));
    }

    @Override
    public int getCount() {
        return records.size();
    }
}
